<?php
namespace app\front\controller;

use app\front\logic\CommonLogic;
use app\front\logic\ApiLogic;
use app\front\logic\MemberLogic;
use app\front\logic\MemberAccountLogic;
use app\front\logic\MemberGradeLogic;

class Member extends MemberBase{
	function getInfo(){
    	return ApiLogic::return($this->lang, 0,'',$this->member_info);
	}

	//获取用户账户金额
	function getAccount(){
		$data = ['total_amount'=>$this->total_amount,
				 'currency_symbol'=>$this->currency_symbol];
		return ApiLogic::return($this->lang, 0,'',$data);
	}

	//获取会员等级列表及等级说明信息
	function getGradeList(){
		$data = MemberGradeLogic::init()->getGradeList($this->lang);
		return ApiLogic::return($this->lang, 0,'',$data);
	}

	//修改密码
	function updatePass(){
		$rs = MemberLogic::init()->updatePass($this->member_info);
		return ApiLogic::return($this->lang, $rs);
	}

	//修改API KEY
	function updateApiKey(){
		$rs = MemberLogic::init()->updateApiKey($this->member_info);
		return ApiLogic::return($this->lang, $rs['code'],'', $rs['data']);
	}

	//获取用户下个月等级情况
	function getNextMouthGrade(){
		$rs = MemberLogic::init()->getNextMouthGrade($this->member_id);
		return ApiLogic::return($this->lang, $rs['code'],'', $rs['data']);
	}
}